package com.ruoyi.mobile.controller;


import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;

import io.swagger.annotations.Api;
import org.css.mobile.system.service.MobileUserService;
import org.css.mobile.system.vo.MobilePersonalInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 用户信息
 *
 * @author zzh
 */
@RestController
@RequestMapping("/mobile/user")
@Api(tags = "移动端用户 controller")
public class MobileUserController extends BaseController {

    @Autowired
    private MobileUserService mobileUserService;

    @GetMapping("/{userId}")
    public AjaxResult getById(@RequestHeader(value = "Authorization", required = false) String token, @PathVariable String userId) {
        return mobileUserService.getUserInfo(Long.valueOf(userId));
    }

    @PostMapping
    public AjaxResult add(MobilePersonalInfoVO dto) {
        return mobileUserService.update(dto);
    }

}
